<?php
//echo "<meta http-equiv=refresh content='60; URL=main.php'>";
require_once("vcl/vcl.inc.php");
require_once("lib/db_connection.php");
require_once("lib/my_library.php");
//Includes
use_unit("components4phpfull/jtgroupbox.inc.php");
use_unit("components4phpfull/jtsectionbar.inc.php");
use_unit("components4phpfull/jtpagecontrol.inc.php");
use_unit("components4phpfull/jtdivwindow.inc.php");
use_unit("platinumgrid/jtplatinumgrid.inc.php");
use_unit("components4phpfull/jtjavascript.inc.php");
use_unit("components4phpfull/jtbevel.inc.php");
use_unit("components4phpfull/jtimagemap.inc.php");
use_unit("menus.inc.php");
use_unit("components4phpfull/jtmenu.inc.php");
use_unit("components4phpfull/jtnavbar.inc.php");
use_unit("components4phpfull/jtvnavbar.inc.php");
use_unit("components4phpfull/jtiframe.inc.php");
use_unit("components4phpfull/jtsitetheme.inc.php");
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");

//Class definition
class fms_main extends Page
{
       public $imgGenerator = null;
       public $Image9 = null;
       public $hfset = null;
       public $hfro = null;
       public $hfpart = null;
       public $hftire = null;
       public $imgUserLevel = null;
       public $imgTooCool = null;
       public $JTDivInfo = null;
       public $JTGroupBox5 = null;
       public $Label13 = null;
       public $frameSessioChecker = null;
       public $hfroute = null;
       public $JTComplogo = null;
       public $hfstyle = null;
       public $hfveh = null;
       public $top_report = null;
       public $imgContact = null;
       public $Image1 = null;
       public $imgPageBackground = null;
       public $imgLogout = null;
       public $hfCompanyId = null;
       public $hfAgree = null;
       public $flag = null;
       public $hfPassword = null;
       public $hfPassword2 = null;
       public $hiddenVeh = null;
       public $hfSettings = null;
       public $checkDefault = null;
       public $check_settings = null;
       public $JTJavaScript2 = null;
       public $JTJavaScript1 = null;
       public $JTJavaScript3 = null;
       public $Image8 = null;
       public $Label5 = null;
       public $Label4 = null;
       public $Image7 = null;
       public $Image6 = null;
       public $Image5 = null;
       public $Label3 = null;
       public $JTDivReset = null;
       public $Button1 = null;
       public $lblPasswordError = null;
       public $btnReset = null;
       public $editUsername = null;
       public $editPassword = null;
       public $Label2 = null;
       public $Label1 = null;
       public $imgwhite2 = null;
       public $imgReset = null;
       public $imgWhite = null;
       public $imgCheckReminders = null;
       public $imgReports = null;
       public $JTIFrameAds2 = null;
       public $imgAmps = null;
       public $Image4 = null;
       public $Image2 = null;
       public $JTFramePersonnel = null;
       public $JTPersonnel = null;
       public $JTFrameReminders = null;
       public $JTPlatinumVehicleList = null;
       public $JTPageRemind = null;
       public $Image3 = null;
       public $editPopReminder = null;
       public $btnRouteLog = null;
       public $imgVehRemind = null;
       public $imgTask = null;
       public $JTDivWindow1 = null;
       public $imgPersonnel = null;
       public $imgVendors = null;
       public $imgDrop = null;
       public $imgWO = null;
       public $imgSet = null;
       public $imgBg = null;
       public $imgVeh = null;
       public $imgAddUser = null;
       public $lblUser = null;
       public $lblDate = null;
       public $lblSlogan = null;
       public $JTFrameMain = null;
       public $lblCompany = null;
       public $btnInventory = null;
       public $btnTireMgmt = null;
       public $JTSiteTheme1 = null;
       function imgGeneratorJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
        document.images['imgGenerator'].src="image/btn_generator.png"
       <?php

       }

       function imgGeneratorJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgGenerator'].src="image/btn_generator2.png"
       <?php

       }

       function imgGeneratorJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       //removeSub();
       //document.getElementById('flag').value = 'imgSet';
       //document.images['imgSet'].src="image/new_settings3.png"
       //clear('imgSet');
       //document.getElementById('JTFrameMain').src = 'standard_droplist.php';
       window.open("lib/GLOBE_AMPS_INSTALLER.exe","Window1");
       <?php

       }



       function imgUserLevelJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
         removeSub();
       document.getElementById('flag').value = 'imgSet';
       document.images['imgSet'].src="image/new_settings3.png"
       clear('imgSet');
       document.getElementById('JTFrameMain').src = 'user_access_level.php';
       <?php

       }

       function imgUserLevelJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgUserLevel'].src="image/btn_user.png"
       <?php

       }

       function imgUserLevelJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgUserLevel'].src="image/btn_user2.png"
       <?php

       }

       function imgTooCoolJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgTooCool'].src="image/too_cool.png"
       <?php

       }

       function imgTooCoolJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgTooCool'].src="image/too_cool2.png"
       <?php

       }

       function JTDivWindow1JSHelp($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.getElementById('JTDivInfo').Show();
       <?php

       }


       function top_reportJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       window.open("select_report.php","Window1","width=500,height=400,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=400,top=200");
       <?php

       }

       function top_reportJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       if(document.getElementById('hfSettings').value==1)
       {
       if(document.getElementById('flag').value != 'top_report')
        {
        document.images['top_report'].src="image/top_reports.png"
        }
        }
       <?php

       }

       function top_reportJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       if(document.getElementById('hfSettings').value==1)
       {
       removeSub();
        if(document.getElementById('flag').value != 'top_report')
        {
        document.images['top_report'].src="image/top_reports2.png"
        }
        else
        {
        document.images['top_report'].src="image/top_reports2.png"
        }
        }
       <?php

       }

       function imgContactJSClick($sender, $params)
       {

       ?>
       document.getElementById('flag').value = 'imgContact';
       document.images['imgContact'].src="image/btn_contact2.png"
       clear('imgContact');
       document.getElementById('JTFrameMain').src = 'contact_us.php';

       <?php

       }

       function imgContactJSMouseOver($sender, $params)
       {

       ?>


       if(document.getElementById('hfSettings').value==1)
       {
       removeSub();
       if(document.getElementById('flag').value != 'imgContact')
       {
       document.images['imgContact'].src="image/btn_contact2.png"
       }
       else
       {
       document.images['imgContact'].src="image/btn_contact2.png"
       }
       }



       <?php

       }

       function imgContactJSMouseOut($sender, $params)
       {

       ?>
       if(document.getElementById('hfSettings').value==1)
       {
       if(document.getElementById('flag').value != 'imgContact')
       {
       document.images['imgContact'].src="image/btn_contact.png"
       }
       }

       <?php

       }

       function Image1JSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['Image1'].src="image/wizard.png"
       <?php

       }

       function Image1JSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       var win_height = 600;
       var win_width = 800;
       var height = window.outerHeight;
       var width = window.outerWidth;
       var top = Math.round((height-win_height)/2);
       var left = Math.round((width-win_width)/2);
       window.open('set_wizard.php','settings_window','scrollbars=yes,location=no,height='+win_height+',width='+win_width+',top='+top+',left='+left);
       <?php

       }



       function lblUserJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.getElementById('JTFrameMain').src = "register_company_edit.php";
       <?php

       }

       function Image8JSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       <?php

       }


       function imgPageBackgroundJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       <?php

       }



       function editPasswordJSChange($sender, $params)
       {

       ?>
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url="sha1.php";
url=url+"?str="+document.getElementById('editPassword').value;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
       <?php

       }


       function btnResetJSClick($sender, $params)
       {
       ?>
       var pass1= document.getElementById('hfPassword').value;
       var pass2= document.getElementById('hfPassword2').value;
       if(pass1==pass2)
       {
       var ask = confirm('Are you sure you want to restore default settings?');
       if(ask)
       {
        xmlhttp=GetXmlHttpObject();
        if (xmlhttp==null)
        {
         alert ("Your browser does not support AJAX!");
         return;
        }
        var url="reset_default_settings.php?reset=1";
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        alert('Successfully reset your settings!');
        document.getElementById('editPassword').value = '';
        document.getElementById('JTDivReset').Hide();

       }
       }
       else
       {
       alert('Incorrect Password');
       }
       <?php

       }


       function Button1JSClick($sender, $params)
       {

       ?>
       var pass1= document.getElementById('hfPassword').value;
       var pass2= document.getElementById('hfPassword2').value;
       alert(pass1+'\n'+pass2);
       <?php

       }
       function imgResetJSClick($sender, $params)
       {

       ?>
       document.getElementById('JTDivReset').Show();
       <?php

       }

       function imgResetJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgReset'].src="image/btn_reset.png"
       <?php

       }

       function imgResetJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgReset'].src="image/btn_reset2.png"
       <?php

       }


       function imgReportsJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       window.open("select_report.php","Window1","width=500,height=400,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=400,top=200");
       <?php

       }

       function imgCheckRemindersJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       document.getElementById('flag').value = 'imgSet';
       document.images['imgSet'].src="image/new_settings3.png"
       clear('imgSet');
       document.getElementById("JTDivWindow1").Show();
       <?php

       }

       function imgCheckRemindersClick($sender, $params)
       {
       $this->JTDivWindow1->setVisible(true);


       }

       function imgReportsJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgReports'].src="image/btn_reports.png"
       <?php

       }

       function imgReportsJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgReports'].src="image/btn_reports2.png"
       <?php

       }

       function imgCheckRemindersJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgCheckReminders'].src="image/btn_check2.png"
       <?php

       }

       function imgCheckRemindersJSMouseOut($sender, $params)
       {
       u
       ?>
       //Add your javascript code here
       document.images['imgCheckReminders'].src="image/btn_check.png"
       <?php

       }

       function imgAddUserJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       document.getElementById('flag').value = 'imgSet';
       document.images['imgSet'].src="image/new_settings3.png"
       clear('imgSet');
       document.getElementById('JTFrameMain').src = 'user_list.php';
       <?php

       }


       function Image1JSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['Image1'].src="image/wizard2.png"
       <?php

       }

       function imgAmpsJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       document.getElementById('flag').value = 'imgAmps';
       //document.images['imgVeh'].src="image/amps_logo.png"
       clear('imgAmps');
       document.getElementById('JTFrameMain').src = 'home.php';
       <?php

       }


       function imgWOClick($sender, $params)
       {
       echo '<script language=javascript>
       window.open("company_workorders.php,"Window1",  "menubar=no,width=495,height=208,left=300,top=230,toolbar=no");
       </script>';
       }

       function btnInventoryJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.getElementById('flag').value = 'btnInventory';
       document.images['btnInventory'].src="image/new_inventory3.png"
       clear('btnInventory');
       document.getElementById('JTFrameMain').src = 'inventory_list.php';
       <?php

       }

       function imgTaskJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgTask'].src="image/btn_task.png"
       <?php

       }

       function imgTaskJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgTask'].src="image/btn_task2.png"
       <?php

       }

       function imgVehRemindJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgVehRemind'].src="image/btn_vehReminders.png"
       <?php

       }

       function imgVehRemindJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgVehRemind'].src="image/btn_vehReminders2.png"
       <?php

       }

       function imgTaskJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       document.getElementById('flag').value = 'imgSet';
       document.images['imgSet'].src="image/new_settings3.png"
       clear('imgSet');
       document.getElementById('JTFrameMain').src = 'template_list.php';
       <?php

       }

       function imgVehRemindJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       document.getElementById('flag').value = 'imgSet';
       document.images['imgSet'].src="image/new_settings3.png"
       clear('imgSet');
       document.getElementById('JTFrameMain').src = 'setup_vehicle_reminders.php';
       <?php

       }

       function reload($vehicle_id,$veh_style)
       {
       //die($vehicle_id.'-'.$veh_style);
       $this->JTFrameReminders->setURL('reminder.php?veh='.$vehicle_id.'&style='.$veh_style);
       }

       function JTPlatinumVehicleListShow($sender, $params)
       {

        $comp_id = $_SESSION['company_id'];
        $query_veh = "select * from vehicle_tbl where company_id='".$comp_id."'";
        $result_veh = mysql_query($query_veh)or die(mysql_error());

        $arr = array();
        $ctr = 1;
        while($row_veh = mysql_fetch_array($result_veh))
          {
            $vehicle_id = $row_veh['vehicle_id'];
            $veh_style = $row_veh['style_name'];

            //if($this->hiddenVeh->getValue()==$vehicle_id)
            //$radio = "<a href=main.php?veh=".$vehicle_id."><img src='image/radio_select.png' border></a>";
            //else
            //$radio = "<a href=main.php?veh=".$vehicle_id."><img src='image/radio.png' border></a>";
            //$VIN = "<a href=vehicle_edit.php?veh=".$vehicle_id.">".$row['VIN']."</a>";
            if($ctr <= 1)
            {
            $radio = "<input type='radio' name='radio' onClick=document.getElementById('JTFrameReminders').src='reminder.php?veh=".$vehicle_id."' checked />";
            //$this->JTFrameReminders->setURL('reminder.php?veh='.$vehicle_id);
            $this->reload($vehicle_id);
            }
            else
            {
            $radio = "<input type='radio' name='radio' onClick=document.getElementById('JTFrameReminders').src='reminder.php?veh=".$vehicle_id."' />";
            //$this->reload($vehicle_id);
            }



            $arr[] = array(
                        'Plate Num' => $radio.'  '."<font style='text-transform: uppercase;'>".$row['veh_num']."</font>",
                        'Year' => $row_veh['year'],
                        'Make' => $row_veh['manufacturer_name'],
                        'Model' => $row_veh['model_name']
                        );

            $ctr = $ctr + 1;
          }


            $this->JTPlatinumVehicleList->setCellData($arr);


       }

       function btnTireMgmtJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.getElementById('flag').value = 'btnTireMgmt';
       document.images['btnTireMgmt'].src="image/new_tire3.png"
       clear('btnTireMgmt');
       document.getElementById('JTFrameMain').src = 'tire_list.php';
       <?php

       }



       function lblUserJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       <?php

       }

       function Image3JSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       <?php

       }


       function lblSloganJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       <?php

       }

       function lblCompanyJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       <?php

       }



       function imgPersonnelJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgPersonnel'].src="image/btn_Personnel.png"
       <?php

       }

       function imgPersonnelJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgPersonnel'].src="image/btn_Personnel2.png"
       <?php

       }

       function imgVendorsJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgVendors'].src="image/btn_Vendors.png"
       <?php

       }

       function imgVendorsJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgVendors'].src="image/btn_Vendors2.png"
       <?php

       }


       function imgPersonnelJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       document.getElementById('flag').value = 'imgSet';
       document.images['imgSet'].src="image/new_settings3.png"
       clear('imgSet');
       document.getElementById('JTFrameMain').src = 'personnel_list.php';
       <?php

       }

       function imgVendorsJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       document.getElementById('flag').value = 'imgSet';
       document.images['imgSet'].src="image/new_settings3.png"
       clear('imgSet');
       document.getElementById('JTFrameMain').src = 'vendor_list.php';
       <?php

       }

       function imgInsuranceJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       <?php

       }

       function imgGaugesJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
        removeSub();
       <?php

       }

       function imgTiresJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
        removeSub();
       <?php

       }

       function imgLegalJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
        removeSub();
       <?php

       }

       function imgDropJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       document.getElementById('flag').value = 'imgSet';
       document.images['imgSet'].src="image/new_settings3.png"
       clear('imgSet');
       document.getElementById('JTFrameMain').src = 'standard_droplist.php';
       <?php

       }

       function imgAssetJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
        removeSub();
       <?php

       }

       function imgReminderJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
        removeSub();
       <?php

       }

       function imgWOJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       document.getElementById('flag').value = 'imgSet';
       document.images['imgSet'].src="image/new_settings3.png"
       clear('imgSet');
       document.getElementById('JTFrameMain').src = 'company_workorders.php';

       //window.open("company_workorders.php,"Window1",  "menubar=no,width=495,height=208,left=300,top=230,toolbar=no");
       <?php

       }

       function imgTasksJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       document.getElementById('flag').value = 'imgReminders';
       document.images['imgReminders'].src="image/new_reminders3.png"
       clear('imgReminders');
       document.getElementById('JTFrameMain').src = 'template_list.php';
       <?php

       }

       function imgSetupJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       document.getElementById('flag').value = 'imgReminders';
       document.images['imgReminders'].src="image/new_reminders3.png"
       clear('imgReminders');
       document.getElementById('JTFrameMain').src = 'setup_vehicle_reminders.php';


       <?php

       }

       function imgSetJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgVehRemind'].style.display='block';
       document.images['imgGenerator'].style.display='block';
       document.images['imgTask'].style.display='block';
       document.images['imgBg'].style.display='block';
       document.images['imgDrop'].style.display='block';
       document.images['imgWO'].style.display='block';
       document.images['imgVendors'].style.display='block';
       document.images['imgPersonnel'].style.display='block';
       //document.images['imgReports'].style.display='block';
       document.images['imgCheckReminders'].style.display='block';
       document.images['imgAddUser'].style.display='block';
       document.images['imgWhite'].style.display='block';
       document.images['imgReset'].style.display='block';
       <?php

       }


       function btnRouteLogJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.getElementById('flag').value = 'btnRouteLog';
       document.images['btnRouteLog'].src="image/new_route3.png"
       clear('btnRouteLog');
       document.getElementById('JTFrameMain').src = 'route_log_list2.php';
       <?php

       }


       function imgVehJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.getElementById('flag').value = 'imgVeh';
       document.images['imgVeh'].src="image/new_vehicles3.png"
       clear('imgVeh');
       document.getElementById('JTFrameMain').src = 'vehicle_list.php';
       <?php

       }

       function imgCloseJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgClose'].src="image/close.png"
       <?php

       }

       function imgCloseJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgClose'].src="image/close2.png"
       <?php

       }

       /*function imgCloseClick($sender, $params)
       {
       $this->imgClose->Visible=false;
       $this->imgBg->Visible=false;
       $this->imgLegal->Visible=false;
       $this->imgGauges->Visible=false;
       $this->imgBilling->Visible=false;
       $this->imgAsset->Visible=false;
       $this->imgDrop->Visible=false;
       $this->imgInsurance->Visible=false;
       $this->imgWO->Visible=false;
       $this->imgTires->Visible=false;
       $this->imgReminder->Visible=false;
       }  */


       /*function imgSetClick($sender, $params)
       {
       $this->imgClose->Visible=true;
       $this->imgBg->Visible=true;
       $this->imgLegal->Visible=true;
       $this->imgGauges->Visible=true;
       $this->imgBilling->Visible=true;
       $this->imgAsset->Visible=true;
       $this->imgDrop->Visible=true;
       $this->imgInsurance->Visible=true;
       $this->imgWO->Visible=true;
       $this->imgTires->Visible=true;
       $this->imgReminder->Visible=true;
       }  */

       function imgGaugesJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgGauges'].src="image/btn_gauges2.png"
       <?php

       }

       function imgGaugesJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgGauges'].src="image/btn_gauges.png"
       <?php

       }

       function imgAssetJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgAsset'].src="image/btn_asset2.png"
       <?php

       }

       function imgAssetJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgAsset'].src="image/btn_asset.png"
       <?php

       }


       /*function imgSetJSClick($sender, $params)
       {

       ?>
       //Add your javascript code here
       window.open("Settings.php","Window1","menubar=no,width=936,height=616,toolbar=no,align=center");
       <?php

       } */

       function imgSetJSMouseOut($sender, $params)
       {

       ?>
       if(document.getElementById('hfSettings').value==1)
       {
       if(document.getElementById('flag').value != 'imgSet')
       {
       document.images['imgSet'].src="image/new_settings1.png"
       }
       }
       //document.images['imgSet'].src="image/new_settings1.png"
       var access_settings = document.getElementById('hfset').value;
       if(access_settings==1)
       {
       document.images['imgSet'].src="image/new_settings4.png"
       }
       <?php

       }

       function imgSetJSMouseOver($sender, $params)
       {

       ?>
       if(document.getElementById('hfSettings').value==1)
       {
       removeSub();
       if(document.getElementById('flag').value != 'imgSet')
       {
       document.images['imgSet'].src="image/new_settings2.png"
       }
       else
       {
       document.images['imgSet'].src="image/new_settings3.png"
       }
       }
       //document.images['imgSet'].src="image/new_settings2.png"

       var access_settings = document.getElementById('hfset').value;
       if(access_settings==1)
       {
       document.images['imgSet'].src="image/new_settings4.png"
       }
       <?php

       }

       function imgVehJSMouseOut($sender, $params)
       {

       ?>
       if(document.getElementById('hfSettings').value==1)
       {
       if(document.getElementById('flag').value != 'imgVeh')
       {
       document.images['imgVeh'].src="image/new_vehicles1.png"
       }
       }
       <?php

       }

       function imgVehJSMouseOver($sender, $params)
       {

       ?>
       if(document.getElementById('hfSettings').value==1)
       {
       removeSub();
       if(document.getElementById('flag').value != 'imgVeh')
       {
       document.images['imgVeh'].src="image/new_vehicles2.png"
       }
       else
       {
       document.images['imgVeh'].src="image/new_vehicles3.png"
       }
       }
       <?php

       }



       function fms_mainJSLoad($sender, $params)
       {

       ?>
       //var pop = document.fms_main.editPopReminder.value;
       //if(pop==1)
       //{
       //document.fms_main.editPopReminder.value = 2;
       //window.open("PopReminder.php","Window1","menubar=no,width=800,height=600,toolbar=no,align=center");
       //}'
       checkDefault();
       checkSettings();
       document.images['imgGenerator'].style.display='none';
       document.images['imgTask'].style.display='none';
       //document.images['imgVehRemind'].style.display='none';
       document.images['imgBg'].style.display='none';
       document.images['imgDrop'].style.display='none';
       document.images['imgWO'].style.display='none';
       document.images['imgVendors'].style.display='none';
       document.images['imgPersonnel'].style.display='none';
       //document.images['imgReports'].style.display='none';
       document.images['imgCheckReminders'].style.display='none';
       //document.images['imgAddUser'].style.display='none';
       document.images['imgWhite'].style.display='none';
       document.images['imgReset'].style.display='none';
       //document.images['imgwhite2'].style.display='none';
       //document.images['imgUserLevel'].style.display='none';
       document.getElementById('lblUser').style.color = "#FFE87C";
       document.getElementById('lblUser').style.textDecoration = "underline";
       document.getElementById('JTPlatinumVehicleList_colitem_hdr_0').width = '201';
       document.getElementById('JTPlatinumVehicleList_colitem_hdr_1').width = '201';
       document.getElementById('JTPlatinumVehicleList_colitem_hdr_2').width = '201';
       document.getElementById('JTPlatinumVehicleList_colitem_hdr_3').width = '201';
       document.getElementById('JTPlatinumVehicleList_colitem_body_0').width = '201';
       document.getElementById('JTPlatinumVehicleList_colitem_body_1').width = '201';
       document.getElementById('JTPlatinumVehicleList_colitem_body_2').width = '201';
       document.getElementById('JTPlatinumVehicleList_colitem_body_3').width = '201';

       parent.document.getElementById('JTFrameComplogo').contentDocument.location.href='CompanyLogo.php?random='+Math.random();
       <?php

       }

       function imgLogoutJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgLogout'].src="image/logout.png"
       <?php

       }

       function imgLogoutJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       removeSub();
       document.images['imgLogout'].src="image/logout2.png"
       <?php

       }

       function imgAddUserJSMouseOut($sender, $params)
       {

       ?>
       document.images['imgAddUser'].src="image/user_mng.png"
       <?php

       }

       function imgAddUserJSMouseOver($sender, $params)
       {

       ?>
       document.images['imgAddUser'].src="image/user_mng_blue.png"

       <?php

       }

       function imgDropJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgDrop'].src="image/btn_drop.png"
       <?php

       }

       function imgDropJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgDrop'].src="image/btn_drop2.png"
       <?php

       }

       function imgWOJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgWO'].src="image/btn_wo2_sum.png"
       <?php

       }

       function imgWOJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgWO'].src="image/btn_wo2_sum2.png"
       <?php

       }

       function imgInsuranceJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgInsurance'].src="image/btn_insurance.png"
       <?php

       }

       function imgInsuranceJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgInsurance'].src="image/btn_insurance2.png"
       <?php

       }


       function imgReminderJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgReminder'].src="image/btn_reminder.png"
       <?php

       }

       function imgReminderJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgReminder'].src="image/btn_reminder2.png"
       <?php

       }


       function imgLegalJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgLegal'].src="image/btn_legal.png"
       <?php

       }

       function imgLegalJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgLegal'].src="image/btn_legal2.png"
       <?php

       }

       function imgTiresJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgTires'].src="image/btn_tires2.png"
       <?php

       }

       function imgTiresJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgTires'].src="image/btn_tires.png"
       <?php

       }

      function imgTasksJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgTasks'].src="image/new_taskTemplate1.png";

       <?php

       }

       function imgTasksJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgTasks'].src="image/new_taskTemplate2.png";
       <?php

       }

       function imgSetupJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgSetup'].src="image/new_vehReminders1.png"
       <?php

       }

       function imgSetupJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgSetup'].src="image/new_vehReminders2.png"
       <?php

       }


       function btnTireMgmtJSMouseOut($sender, $params)
       {

       ?>
       if(document.getElementById('hfSettings').value==1)
       {
       if(document.getElementById('flag').value != 'btnTireMgmt')
       {
       document.images['btnTireMgmt'].src="image/new_tire1.png"
       }
       }

       var access_tire = document.getElementById('hftire').value;
       if(access_tire==0)
       {
       document.images['btnTireMgmt'].src="image/new_tire4.png"
       }
       <?php

       }

       function btnTireMgmtJSMouseOver($sender, $params)
       {

       ?>
       if(document.getElementById('hfSettings').value==1)
       {
       removeSub();
       if(document.getElementById('flag').value != 'btnTireMgmt')
       {
       document.images['btnTireMgmt'].src="image/new_tire2.png"
       }
       else
       {
       document.images['btnTireMgmt'].src="image/new_tire3.png"
       }
       }

       var access_tire = document.getElementById('hftire').value;
       if(access_tire==0)
       {
       document.images['btnTireMgmt'].src="image/new_tire4.png"
       }
       <?php

       }


       function btnInventoryJSMouseOut($sender, $params)
       {

       ?>
       if(document.getElementById('hfSettings').value==1)
       {
       if(document.getElementById('flag').value != 'btnInventory')
       {
       document.images['btnInventory'].src="image/new_inventory1.png"
       }
       }

       var access_part = document.getElementById('hfpart').value;
       if(access_part==0)
       {
       document.images['btnInventory'].src="image/new_inventory4.png"
       }
       <?php

       }

       function btnInventoryJSMouseOver($sender, $params)
       {

       ?>
       if(document.getElementById('hfSettings').value==1)
       {
       removeSub();
       if(document.getElementById('flag').value != 'btnInventory')
       {
       document.images['btnInventory'].src="image/new_inventory2.png"
       }
       else
       {
       document.images['btnInventory'].src="image/new_inventory3.png"
       }
       }

       var access_part = document.getElementById('hfpart').value;
       if(access_part==0)
       {
       document.images['btnInventory'].src="image/new_inventory4.png"
       }
       <?php

       }


       function imgRemindersJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       if(document.getElementById('flag').value != 'imgReminders')
       {
       document.images['imgReminders'].src="image/new_reminders1.png"
       }
       <?php

       }

       function imgRemindersJSMouseOver($sender, $params)
       {
       ?>
       //Add your javascript code here
       if(document.getElementById('flag').value != 'imgReminders')
       {
       document.images['imgReminders'].src="image/new_reminders2.png"
       document.images['imgSetup'].style.display='block';
       document.images['imgTasks'].style.display='block';
       }
       else
       {
       document.images['imgReminders'].src="image/new_reminders3.png"
       document.images['imgSetup'].style.display='block';
       document.images['imgTasks'].style.display='block';
       }
       <?php

       }

       function btnRouteLogJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       if(document.getElementById('hfSettings').value==1)
       {
       if(document.getElementById('flag').value != 'btnRouteLog')
       {
       document.images['btnRouteLog'].src="image/new_route1.png"
       }
       }

       var flag_route = document.getElementById('hfroute').value;
       if(flag_route==0)
       {
       document.images['btnRouteLog'].src="image/new_route4.png"
       }

       var access_route = document.getElementById('hfro').value;
       if(access_route==0)
       {
       document.images['btnRouteLog'].src="image/new_route4.png"
       }
       <?php

       }

       function btnRouteLogJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here

       if(document.getElementById('hfSettings').value==1)
       {
       removeSub();
       if(document.getElementById('flag').value != 'btnRouteLog')
       {
       document.images['btnRouteLog'].src="image/new_route2.png"
       }
       else
       {
       document.images['btnRouteLog'].src="image/new_route3.png"
       }
       }

       var flag_route = document.getElementById('hfroute').value;
       if(flag_route==0)
       {
       document.images['btnRouteLog'].src="image/new_route4.png"
       }

       var access_route = document.getElementById('hfro').value;
       if(access_route==0)
       {
       document.images['btnRouteLog'].src="image/new_route4.png"
       }
       <?php

       }

       function btnReportViewerJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['btnReportViewer'].src="image/btn_Report.png"
       <?php

       }

       function btnReportViewerJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['btnReportViewer'].src="image/btn_Report2.png"

       <?php

       }

       function reloadp($personnel_id)
       {
       $this->JTFramePersonnel->setURL('reminder_personnel.php?emp='.$personnel_id);
       }



       function fms_mainCreate($sender, $params)
       {
       //die($_SESSION['route_log']);
       $this->JTComplogo->setURL('CompanyLogo.php?random='.rand(0,1000));
       $route_flag = $_SESSION['route_log'];
       $this->hfroute->setValue($route_flag);

       $access_settings =$_SESSION['access_settings'];
       $this->hfset->setValue($access_settings);

       $result_company = mysql_query("SELECT * FROM company_tbl where company_id='".$_SESSION['company_id']."'")or die (mysql_error());
       $row_company = mysql_fetch_array($result_company);

       $access_tire = $row_company['access_tire'];
       $this->hftire->setValue($access_tire);

       $access_part = $row_company['access_part'];
       $this->hfpart->setValue($access_part);

       $access_route = $row_company['access_route'];
       $this->hfro->setValue($access_route);
       /*if($_SESSION['isAdmin']!=1)
       {
       //$this->imgSet->setVisible(false);
       //$this->imgLogout->left=1180;
       //$this->imgAddUser->left=1000;
       //$this->lblUser->left=292;
       //$this->Image3->left=172;
       }

       if($_SESSION['isAdmin']==1)
       {
       //$this->imgSet->setVisible(true);
       //$this->imgSet->Left=1080;
       //$this->imgLogout->left=1180;
       //$this->imgAddUser->left=898;
       //$this->lblUser->left=252;
       //$this->Image3->left=172;
       } */

       $query_account = "SELECT password FROM accounts_tbl WHERE company_id='".$_SESSION['company_id']."' AND username='".$_SESSION['username']."'";
       $result_account = mysql_query($query_account) or die("SELECT ACCOUNT ".mysql_error());
       $row_account = mysql_fetch_array($result_account);
       $this->editUsername->Text = $_SESSION['username'];
       $this->editPassword->Text = '';
       $this->lblPasswordError->Caption = '';
       $this->hfPassword->setValue($row_account['password']);

       $result_vehicle = mysql_query("select * from vehicle_tbl where company_id='".$_SESSION['company_id']."'");
       $veh_count = mysql_num_rows($result_vehicle);

       if($veh_count==0)
       {
       $this->JTDivWindow1->Hide();
       }

       if($veh_count!=0)
       {
       $this->JTDivWindow1->ShowWindow();
       }



        //vehicle reminder
        $comp_id = $_SESSION['company_id'];
        $this->hfCompanyId->setValue($comp_id);
        $query_veh = "select * from vehicle_tbl where company_id='".$comp_id."'";
        $result_veh = mysql_query($query_veh)or die(mysql_error());



        $alert_ctr = 0;

        $arr = array();
        $ctr = 1;
        while($row_veh = mysql_fetch_array($result_veh))
          {

            $this->hfveh->setValue($vehicle_id);
            $this->hfstyle->setValue($veh_style);

            //$this->JTFrameReminders->setURL('reminder.php?veh='.$vehicle_id.'&style='.$veh_style);
            //start (doesn't include no alert vehicles)
            $alert_single = 0;
            $vehicle_id = $row_veh['vehicle_id'];
            $veh_style = $row_veh['style_id'];
            $query_check = "select * from veh_reminder_tbl where vehicle_id='".$vehicle_id."' and status2='Pending'";
            $result_check = mysql_query($query_check)or die(mysql_error());
            $row_count = mysql_num_rows($result_check);

            $query_od = "select * from vehicle_tbl where company_id='".$_SESSION['company_id']."' and vehicle_id='".$vehicle_id."'";
            $result_od = mysql_query($query_od)or die(mysql_error());
            $row_od = mysql_fetch_array($result_od);

            $query_recurring = "select * from template_recurring_tbl where template_style = '".$veh_style."'";
            $result_recurring = mysql_query($query_recurring);
            //$row_recurring = mysql_fetch_array($result_recurring);


          $my_lib = new my_library();
          while($row_check = mysql_fetch_array($result_check))
          {
            if($row_count!=0)
            {
            $due_date = $row_check['due_date'];
            $curr_date = date("Y-m-d");
            $odometer = $row_check['due_hours'];
            $curr_od = $row_od['curr_tracking_value'];
            //$sched_by =

            $track_by = $row_check['schedule_by'];

            if($due_date!=null || $due_date!='')
            $days_diff = $my_lib->daysDifference($due_date, $curr_date);

            $odometer_diff = $odometer - $curr_od;
            //01JULY2010
            //REMIND BEFORE
            if($track_by=='Hours' || $track_by=='Mileage')
            {
              $rem_odom = $row_check['rem_hours'];
            }
            else if($track_by=='Date' || $track_by=='Time')
            {
              $rem_by = $row_check['rem_by'];
              $rem_time = $row_check['rem_time'];
              if($rem_by=='Months')
              $rem_time = $rem_time * 30;
            }

            if($track_by=='Both' && (($days_diff<=$rem_time) || ($odometer_diff<=$rem_odom)))
            {
              $alert_ctr++;
              $alert_single++;
            }
            else if(($track_by=='Hours/Km'|| $track_by=='Hours' || $track_by=='Usage' || $track_by=='Mileage') && ($odometer_diff<=$rem_odom))
            {
              $alert_ctr++;
              $alert_single++;
            }
            else if(($track_by=='Date' || $track_by=='Time')  && ($days_diff<=$rem_time))
            {
              $alert_ctr++;
              $alert_single++;
            }
            }
          }

            //end doesn't include no alert vehicles

            //if($this->hiddenVeh->getValue()==$vehicle_id)
            //$radio = "<a href=main.php?veh=".$vehicle_id."><img src='image/radio_select.png' border></a>";
            //else
            //$radio = "<a href=main.php?veh=".$vehicle_id."><img src='image/radio.png' border></a>";
            //$VIN = "<a href=vehicle_edit.php?veh=".$vehicle_id.">".$row['VIN']."</a>";



            if($ctr <= 1)
            {
            $radio = "<input type='radio' name='radio' onClick=document.getElementById('JTFrameReminders').src='reminder.php?veh=".$vehicle_id."&style=".$veh_style."' checked />";
            if($alert_single!=0)
            $this->reload($vehicle_id, $veh_style);
            //die($row_veh['vehicle_id']);
            //$this->JTFrameReminders->setURL('reminder.php?veh='.$vehicle_id);

            }
            else
            {
            //die($row_veh['vehicle_id']);
            $radio = "<input type='radio' name='radio' onClick=document.getElementById('JTFrameReminders').src='reminder.php?veh=".$vehicle_id."&style=".$veh_style."' />";
            }

            if($alert_single!=0)
            {
            $arr[] = array(
                        'Plate Num' => $radio.'  '."<font style='text-transform: uppercase;'>".$row_veh['veh_num']."</font>",
                        'Year' => $row_veh['year'],
                        'Make' => $row_veh['manufacturer_name'],
                        'Model' => $row_veh['model_name']
                        );

            $ctr = $ctr + 1;
            }
           //$ctr = $ctr + 1;
          }

           if($alert_ctr==0)
            {
              $this->JTDivWindow1->Hide();
            }
            if($alert_ctr!=0)
            {
              $this->JTDivWindow1->ShowWindow();
            }
            $this->JTPlatinumVehicleList->setCellData($arr);
        //end vehicle reminder


        //start personnel reminder
        $query_personnel = "select * from employee_tbl where company_id='".$_SESSION['company_id']."'";
        $result_personnel = mysql_query($query_personnel)or die(mysql_error());


        $emp_ctr = 0;

        $arr = array();
        $ctr_emp = 1;
        while($row_personnel = mysql_fetch_array($result_personnel))
          {
            $personnel_id = $row_personnel['autoid'];
            //$veh_style = $row_veh['style_id'];

            //start (doesn't include no alert vehicles)
            $alert_single1 = 0;

            $query_check1 = "select * from emp_license_tbl where emp_id='".$personnel_id."'";
            $result_check1 = mysql_query($query_check1)or die(mysql_error());
            $row_count1 = mysql_num_rows($result_check1);
            //$row_count1 = mysql_num_rows($result_check1);



          $my_lib = new my_library();
          while($row_check1 = mysql_fetch_array($result_check1))
          {
            if($row_count1!=0)
            {
            $renewal_date = $row_check1['license_renew_date'];
            $remind_me = $row_check1['days'];
            $curr_date = date("Y-m-d");


            if($renewal_date!=null || $renewal_date!='' || $renewal_date!='0000-00-00')
            $day_diff = $my_lib->daysDifference($renewal_date, $curr_date);


            if($day_diff<=$remind_me)
            {
              $emp_ctr++;
              $alert_single1++;
            }
            }
          }

            //end doesn't include no alert vehicles

            //if($this->hiddenVeh->getValue()==$vehicle_id)
            //$radio = "<a href=main.php?veh=".$vehicle_id."><img src='image/radio_select.png' border></a>";
            //else
            //$radio = "<a href=main.php?veh=".$vehicle_id."><img src='image/radio.png' border></a>";
            //$VIN = "<a href=vehicle_edit.php?veh=".$vehicle_id.">".$row['VIN']."</a>";
            if($ctr_emp <= 1)
            {
            $radio1 = "<input type='radio' name='radio_emp' onClick=document.getElementById('JTFramePersonnel').src='reminder_personnel.php?emp=".$personnel_id."' checked />";
            //$this->JTFramePersonnel->setURL('reminder.php?veh='.$vehicle_id);
            $this->reloadp($personnel_id);
            }
            else
            {
            $radio1 = "<input type='radio' name='radio_emp' onClick=document.getElementById('JTFramePersonnel').src='reminder_personnel.php?emp=".$personnel_id."' />";
            }

            if($alert_single1!=0)
            {
            $arr[] = array(
                        'Name' => $radio1.'  '.$row_personnel['lname'].','.$row_personnel['fname'],
                        'Department' => $row_personnel['department'],
                        );
            $ctr_emp = $ctr_emp + 1;
            }
          }

            //echo "<script language=javascript>
            //alert(".$alert_ctr.");
            //</script>";
            /*if($emp_ctr==0)
            {
              $this->JTDivWindow1->setVisible(false);
            }
            if($emp_ctr!=0)
            {
              $this->JTDivWindow1->setVisible(true);
            }*/
            $this->JTPersonnel->setCellData($arr);

          //end personnel reminder


       $this->editPopReminder->Text = '';
       $this->editPopReminder->Text = $_GET['pop'];
       //for pop-up reminders
       $comp_id = $_SESSION['company_id'];
       $result_company = mysql_query("select * from company_tbl where company_id='".$comp_id."'") or die('SELECT COMPANY'.mysql_error());
       $row_company = mysql_fetch_array($result_company);


       //popup!
       $veh_id = $_GET['veh'];
       $this->hiddenVeh->setValue($veh_id);

       //$this->JTFrameReminders->setURL('reminder.php?veh='.$this->hiddenVeh->getValue());
       /*
       $query_vehicle = mysql_query("select * from vehicle_tbl where company_id='".$_SESSION['company_id']."'");
       $temp_vehicle = mysql_num_rows($query_vehicle);

       if($temp_vehicle!=0)
       {
        if($veh_id==null || $veh_id=='')
        {
        $comp_id = $_SESSION['company_id'];
        $query1 = "select * from vehicle_tbl where company_id='".$comp_id."' LIMIT 1";
        $result = mysql_query($query1)or die(mysql_error());
        $row_veh = mysql_fetch_array($result);
        $veh = $row_veh['vehicle_id'];
        //die($query1);
        redirect('main.php?veh='.$veh);
        }
       }
       */




       //$this->top_report->setLink('select_report.php?company_id='.$comp_id);
       //$this->imgCompLogo->ImageSource = $row_company['photo'];
       //$this->imgCompLogo->setLink('register_company_edit.php?company_id='.$comp_id);
       $this->lblDate->Caption = date("Y/m/d") . "<br />";
       $this->lblCompany->Caption = $row_company['company_name'];
       $this->lblSlogan->Caption = $row_company['comp_slogan'];

       $this->lblUser->Font->Color = 'white';

        if($_SESSION['isAdmin']==1)
       {
       $this->lblUser->Caption = $_SESSION['username'];
       //$this->lblUser->setLink('register_company_edit.php?company_id='.$comp_id);

       }

        if($_SESSION['isAdmin']!=1)
       {
       $this->lblUser->Caption = $_SESSION['username'];
       $this->lblUser->setLink();
       }




       if($_SESSION['isAdmin']==1)
       {
       //$this->imgAddUser->setLink('user_list.php');
       }

        if($_SESSION['isAdmin']!=1)
       {
       $this->imgAddUser->setLink();
       }

       //$this->imgSetup->setLink('setup_vehicle_reminders.php?company_id='.$_SESSION['company_id']);
       //$this->imgVeh->setLink('vehicle_list.php?company_id='.$_SESSION['company_id']);
       //$this->imgTasks->setLink('template_list.php?company_id='.$_SESSION['company_id']);
       $this->imgPersonnel->setLink('personnel_list.php?company_id='.$_SESSION['company_id']);
       //$this->btnRouteLog->setLink('route_log_list.php?company_id='.$_SESSION['company_id']);
       $this->imgVendors->setLink('vendor_list.php?company_id='.$_SESSION['company_id']);
       //$this->btnInventory->setLink('inventory_list.php?company_id='.$_SESSION['company_id']);
       //$this->btnTireMgmt->setLink('tire_list.php?company_id='.$_SESSION['company_id']);

       $this->editPopReminder->Hidden=true;

       //$this->imgTires->setLink('company_tires.php?company_id='.$comp_id);
       //$this->imgLegal->setLink('company_legal.php?company_id='.$comp_id);
       //$this->imgGauges->setLink('company_gauges.php?company_id='.$comp_id);
       //$this->imgReminder->setLink('company_reminders.php?company_id='.$comp_id);
       //$this->imgInsurance->setLink('company_insurance.php?company_id='.$comp_id);
       $this->imgWO->setLink('company_workorders.php?company_id='.$comp_id);
       $this->imgDrop->setLink('standard_droplist.php');
       //$this->imgAsset->setLink('company_asset_utilization.php?company_id='.$comp_id);
       $this->imgVehRemind->setLink('setup_vehicle_reminders.php?company_id='.$comp_id);
       $this->imgTask->setLink('template_list.php?company_id='.$comp_id);

       //FOR AGREEMENT - START
       $query_agree = "SELECT * FROM agreement_tbl WHERE company_id='".$comp_id."'";
       $result_agree = mysql_query($query_agree) or die("AGREEMENT ".mysql_error());
       $count_agree = mysql_num_rows($result_agree);
       $this->hfAgree->setValue($count_agree);
       //FOR AGREEMENT  - END

       //FOR FIRST TIME PROMPTO SETTINGS - START
       $query_settings = "SELECT flag_settings FROM company_tbl WHERE company_id='".$comp_id."'";
       $result_settings = mysql_query($query_settings) or die("SETTINGS ".mysql_error());
       $row_settings = mysql_fetch_array($result_settings);
       $flag_sett = $row_settings['flag_settings'];
       $this->hfSettings->setValue($flag_sett);
       //FOR FIRST TIME PROMPTO SETTINGS - END
       }




}

global $application;

global $fms_main;

//Creates the form
$fms_main=new fms_main($application);

//Read from resource file
$fms_main->loadResource(__FILE__);

//Shows the form
$fms_main->show();

?>